package gl.view;

import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

import android.app.DatePickerDialog;
import android.content.Context;

public class SimpleDataPickerDialog extends DatePickerDialog {
	public SimpleDataPickerDialog(Context context, int theme,
			OnDateSetListener callBack, int year, int monthOfYear,
			int dayOfMonth) {
		super(context, theme, callBack, year, monthOfYear, dayOfMonth);
		// 初始化Calendar日历对象
		Calendar mycalendar = Calendar.getInstance(Locale.CHINA);
		Date mydate = new Date(); // 获取当前日期Date对象
		mycalendar.setTime(mydate);// //为Calendar对象设置时间为当前日期

		year = (year != 0 ? year : mycalendar.get(Calendar.YEAR)); // 获取Calendar对象中的年
		monthOfYear = (monthOfYear != 0 ? monthOfYear : mycalendar
				.get(Calendar.MONTH)); // 获取Calendar对象中的年
		dayOfMonth = (dayOfMonth != 0 ? dayOfMonth : mycalendar
				.get(Calendar.DAY_OF_MONTH)); // 获取Calendar对象中的年
		updateDate(year, monthOfYear, dayOfMonth);
	}
	@Override
	public void show() {
		super.show();
	}
}
